Enviado por: phpmysql
Fecha: 2003-06-05 10:16:18
Actualizado: 2004-01-03 09:07:49
¿Usa base de datos?: 0
Visitas: 825
Votos: 0
Descargado: 374 veces
Valoración: 0.00
» Valora este script «
ZipDescargar

Con este script podremos ver enlaces, agregar enlaces, la fecha del enlace, el informe de enlace roto y la pagina de inicio. consta de los siguientes archivos: [b]enlaces.php[/b] que es el archivo donde aparecen los enlaces [codigo] <html> <head> <title>enlaces</title> </head> <body> <div align="center"> <table width="50%" border="1" cellspacing="0"> <tr> <td height="68"><div align="center"><br> <a href="enlaces.php"><img src="web.gif" alt="" width="219" height="42" border="0"></a><br> <br> <font class="content">[ <a href="enlaces.php">Indice</a> | <a href="envia.php">A�adir Enlace</a> ]<br> <br> </font></div></td> </tr> </table> <br> <table width="50%" border="1" cellspacing="0"> <tr> <td><div align="center"> <?php include("enlaces.txt"); #aqu� para cambiar la ruta del archivo que muestra las entradas ?> </div></td> </tr> </table> <br> <br> </div> </body> </html> [/codigo] [b]envia.php[/b] que es el formulario para el envio de enlaces [codigo] <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <div align="center"> <table width="50%" border="1" cellspacing="0"> <tr> <td height="68"><div align="center"><br> <a href="enlaces.php"><img src="web.gif" alt="" width="219" height="42" border="0"></a><br> <br> <font class="content">[ <a href="enlaces.php">Indice</a> | <a href="envia.php">A�adir Enlace</a> ]<br> <br> </font></div></td> </tr> </table> <br> <table width="50%" border="1" cellspacing="0"> <tr> <td><div align="center"> <?php print "<table width='75%' border='0' cellspacing='0'> <form method='post' action='recibe.php' onsubmit='return error ()' name='myform' > <tr> <td width='16%'>Titulo</td> <td width='84%'><input name=titulo type=text id='titulo' maxlenght=30> </td> </tr> <tr> <td height='23'>url del archivo</td> <td>http:// <input name=url type=text id=url2 maxlenght=30></td> </tr> <tr> <td height='23'>Descripcion</td> <td><textarea name='descripcion' id='descripcion2'></textarea></td> </tr> <tr> <td height='23'>Tu email</td> <td><input name=email type=text></td> </tr> <tr> <td height='23'>Tu web</td> <td>Http:// <input name=weburl type=text></td> </tr> <tr> <td height='23'><input name='submit' type=submit value=Enviar></td> <td></td> </tr> <script> function error (){ if (document.myform.titulo.value == '') { alert('Por favor, introduzca el titulo..'); document.myform.titulo.focus(); return false} if (document.myform.url.value == '') { alert('Por favor, introduzca la url.'); document.myform.url.focus(); return false} if (document.myform.descripcion.value == '') { alert('Por favor, introduzca la descripcion.'); document.myform.descripcion.focus(); return false} else return getPermission(); } </script> </form> </table><br>"; ?> </div></td> </tr> </table> <br> <br> </div> </body> </html> [/codigo] [b]recibe.php[/b] es el archivo para procesar el envio de enlaces [codigo] <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <div align="center"> <table width="50%" border="1" cellspacing="0"> <tr> <td height="68"><div align="center"><br> <a href="enlaces.php"><img src="web.gif" alt="" width="219" height="42" border="0"></a><br> <br> <font class="content">[ <a href="enlaces.php">Indice</a> | <a href="envia.php">A�adir Enlace</a> ]<br> <br> </font></div></td> </tr> </table> <br> <table width="50%" border="1" cellspacing="0"> <tr> <td><div align="center"> <?php $pvm = getdate(); $archivo="enlaces.txt"; #aqu� para cambiar la ruta del archivo donde se guardan las entradas $uusi="<table width=75% border=0 cellspacing=0 > <tr> <td height='10'><a href='http://$url' target='_blank'>$titulo</a></td> </tr> <tr> <td height=11><b>Descripci�n:</b> $descripcion</td> </tr> <tr> <td height=23><b>Agregado el: </b>$pvm[mday]-$pvm[mon]-$pvm[year]</td> </tr> <tr> <td height=23><a href=http://$weburl target=new>P�gina de Inicio</a> | <a href=mailto:$email?subject=hay_un_enlace_roto >Informar de un enlace roto</a></td> </tr> </table> <br>nn"; $fp=fopen($archivo, "r+"); $vanha=fread($fp, filesize($archivo)); fseek($fp, 0); fwrite($fp, "${uusi}${vanha}"); fclose($fp); print "Enlace añadido <a href=enlaces.php>regresar</a>"; ?> </div></td> </tr> </table> </div> <div align="center"></div> </body> </html> [/codigo] [b]enlaces.txt[/b] el archivo donde se guardan los enlaces, podemos moficarlo a nuestro gusto ya que es el primer enlace que se muestra [codigo] <table width=75% border=0 cellspacing=0 > <tr> <td height='10'><a href='http://phpmysql.webcindario.com'target='_blank'>Phpmysql</a></td> </tr> <tr> <td height=11><b>Descripci�n:</b> scripts en php y mysql</td> </tr> <tr> <td height=23><a href=http://phpmysql.webcindario.com target=new>P�gina de Inicio</a> | <a href=mailto:[email protected]?subject=hay_un_enlace_roto >Informar de un enlace roto</a></td> </tr> </table> [/codigo] Y por ultimo necesitaremos una imagen, que guardaremos junto a los demas fichero (boton derecho rato, guardar imagen como..) [b]web.gif[/b] [img]http://elcidop.webcindario.com/modules/Web_Links/images/web.gif[/img] Sistema de enlaces_sin_mysql by www.phpmysq.tk and www.elcidop.tk